package com.zf.yichat.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

@Table(name = "user_energy_block_details")
public class UserEnergyBlockDetails implements Serializable {


    // 获取能量块
    public static final String OBTAIN = "0";
    // 使用能量块
    public static final String USE = "1";
    // 未领取
    public static final String UNCLAIMED = "0";
    // 已领取
    public static final String RECEIVED = "1";


    @Id
    private Long id;

    /**
     * 用户ID
     */
    @Column(name = "user_id")
    private Long userId;

    private Long treeId;

    /**
     * 获取的能量块数量
     */
    @Column(name = "total_num")
    private Integer totalNum;

    /**
     * 类型 0 获取  1 使用 
     */
    private String type;

    /**
     * 状态 0 未领取  1 已领取 
     */
    private String status;

    @Column(name = "create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Column(name = "receive_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date receiveTime;

    private static final long serialVersionUID = 1L;

    public UserEnergyBlockDetails(Long id, Long userId,Long treeId, Integer totalNum, String type, String status, Date createTime, Date receiveTime) {
        this.id = id;
        this.userId = userId;
        this.treeId = treeId;
        this.totalNum = totalNum;
        this.type = type;
        this.status = status;
        this.createTime = createTime;
        this.receiveTime = receiveTime;
    }

    public UserEnergyBlockDetails() {
        super();
    }

    /**
     * @return id
     */
    public Long getId() {
        return id;
    }

    /**
     * @param id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 获取用户ID
     *
     * @return user_id - 用户ID
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * 设置用户ID
     *
     * @param userId 用户ID
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getTreeId() {
        return treeId;
    }

    public void setTreeId(Long treeId) {
        this.treeId = treeId;
    }

    /**
     * 获取获取的能量块数量
     *
     * @return total_num - 获取的能量块数量
     */
    public Integer getTotalNum() {
        return totalNum;
    }

    /**
     * 设置获取的能量块数量
     *
     * @param totalNum 获取的能量块数量
     */
    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    /**
     * 获取类型 0 获取  1 使用 
     *
     * @return type - 类型 0 获取  1 使用 
     */
    public String getType() {
        return type;
    }

    /**
     * 设置类型 0 获取  1 使用 
     *
     * @param type 类型 0 获取  1 使用 
     */
    public void setType(String type) {
        this.type = type == null ? null : type.trim();
    }

    /**
     * 获取状态 0 未领取  1 已领取 
     *
     * @return status - 状态 0 未领取  1 已领取 
     */
    public String getStatus() {
        return status;
    }

    /**
     * 设置状态 0 未领取  1 已领取 
     *
     * @param status 状态 0 未领取  1 已领取 
     */
    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    /**
     * @return create_time
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * @param createTime
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * @return receive_time
     */
    public Date getReceiveTime() {
        return receiveTime;
    }

    /**
     * @param receiveTime
     */
    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }
}